翻訳と辞書
Words near each other
・ Inherit the Earth (film)
・ Inherit the Void
・ Inherit the Wind
・ Inherit the Wind (1960 film)
・ Inherit the Wind (1965 film)
・ Inherit the Wind (1988 film)
・ Inherit the Wind (1999 film)
・ Inherit the Wind (play)
・ Inheritance
・ Inheritance (1920 film)
・ Inheritance (2001 film)
・ Inheritance (2006 film)
・ Inheritance (2012 film)
・ Inheritance (disambiguation)
・ Inheritance (genetic algorithm)
Inheritance (object-oriented programming)
・ Inheritance (Paolini novel)
・ Inheritance (Provision for Family and Dependants) Act 1975
・ Inheritance (short story)
・ Inheritance (TV series)
・ Inheritance Cycle
・ Inheritance Fund (Sweden)
・ Inheritance law in Bulgaria
・ Inheritance law in Canada
・ Inheritance of acquired characteristics
・ Inheritance of Hope
・ Inheritance tax
・ Inheritance Tax (United Kingdom)
・ Inheritance Trilogy
・ Inheritance Trilogy (science fiction)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Inheritance (object-oriented programming) : ウィキペディア英語版
Inheritance (object-oriented programming)

Inheritance (OOP) is when an object or class is based on another object (prototypal inheritance) or class (class-based inheritance), using the same implementation (inheriting from an object or class) specifying implementation to maintain the same behavior (realizing an interface; inheriting behavior). It is a mechanism for code reuse and to allow independent extensions of the original software via public classes and interfaces. The relationships of objects or classes through inheritance give rise to a hierarchy. Inheritance was invented in 1967 for Simula.
Inheritance should not be confused with subtyping. In some languages inheritance and subtyping agree, while in others they differ; in general subtyping establishes an is-a relationship, while inheritance only reuses implementation and establishes a syntactic relationship, not necessarily a semantic relationship (inheritance does not ensure behavioral subtyping). To distinguish these concepts, subtyping is also known as ''interface inheritance,'' while inheritance as defined here is known as ''implementation inheritance'' or ''code inheritance''. Still, inheritance is a commonly used mechanism for establishing subtype relationships.
Inheritance is contrasted with object composition, where one object ''contains'' another object (or objects of one class contain objects of another class); see composition over inheritance. Composition implements a has-a relationship, in contrast to the is-a relationship of subtyping.
==Types of inheritance==

There are various types of inheritance, based on paradigm and specific language.
;Single inheritance: where subclasses inherit the features of one super class. A class acquires the properties of another class.
;Multiple inheritance: where one class can have more than one super class and inherit features from all parent classes.
;Multilevel inheritance: where a subclass is inherited from another subclass. It is not uncommon that a class is derived from another derived class as shown in the figure "Multilevel inheritance". The class ''A'' serves as a ''base class'' for the ''derived class'' ''B'', which in turn serves as a ''base class'' for the ''derived class'' ''C''. The class ''B'' is known as ''intermediate'' base class since it provides a link for the inheritance between ''A'' and ''C''. The chain ''ABC'' is known as ''inheritance path''.
A derived class with multilevel inheritance is declared as follows:

Class A(...); //Base class
Class B : public A(...); //B derived from A
Class C : public B(...); //C derived from B

This process can be extended to any number of levels.
;Hierarchical inheritance: where one class serves as a superclass (base class) for more than one sub class.
;Hybrid inheritance: a mix of two or more of the above types of inheritance.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Inheritance (object-oriented programming)」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.